package com.googlecode.horncomb.organ;

import javax.persistence.Column;

import com.googlecode.horncomb.organ.support.ViewObject;
import com.googlecode.horncomb.organ.support.OrganObject;
import com.googlecode.horncomb.organ.support.StringIdentifiable;

public interface Relation<SourceType extends RelationPoint, TargetType extends RelationPoint>
		extends StringIdentifiable, ViewObject, OrganObject {
	/** 对偶关系 */
	public String getDualRelationId();

	public void setDualRelationId(String relation);

	/**
	 * 是否双向关系
	 * @return
	 */
	public boolean isBidirection();

	/**
	 * 设置关系的源组织.
	 * @param source
	 *            源组织,不允许为空.
	 */
	public void setSource(SourceType source);

	/**
	 * 设置关系的源组织.
	 * @param target
	 *            源组织,不允许为空.
	 */
	public SourceType getSource();

	/**
	 * @return 关系的目标组织.
	 */
	public TargetType getTarget();

	/**
	 * 设置关系的目标组织.
	 * @param target
	 *            目标组织,不允许为空.
	 */
	public void setTarget(TargetType target);

	/**
	 * @return the natureType
	 */
	@Column(name = "NATURE_")
	public String getNature();

	/**
	 * @param natureType the natureType to set
	 */
	public void setNature(String natureType);
}
